import Native from '@/service/native'

export default {
  getMxUserInfo(context, user) {
    return new Promise(resolve => {
      Native.apiCall('MideaUser', 'getUser', [])
      .then(user => {
        context.commit('updateTimestamp', Date.now())
        context.commit('updateUser', user)
        resolve(user)
      })
      .catch(error => {
        console.log('error', error)
      })
    })
  },
}
